<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="http://shiro.apache.org/tags"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!DOCTYPE html>
<html>
<head>
<title>主页</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css"
	href="jquery/themes/bootstrap/easyui.css">
<link rel="stylesheet" type="text/css" href="jquery/themes/icon.css">
<script type="text/javascript" src="jquery/jquery.min.js"></script>
<script type="text/javascript" src="jquery/jquery.easyui.min.js"></script>
<script type="text/javascript" src="jquery/easyui-lang-zh_CN.js"></script>

<script type="text/javascript">
	if (window.history && window.history.pushState) {
		$(window).on('popstate', function() {
			window.history.pushState('forward', null, '');
			window.history.forward(1);
		});
	}
	window.history.pushState('forward', null, ''); //在IE中必须得有这两行
	window.history.forward(1);
	function openTabs(text, url) {
		if ($("#tabs").tabs('exists', text)) {
			$("#tabs").tabs('select', text);
		} else {
			var myContext = "<iframe frameborder='0' scrolling='auto' style='width:100%;height:100%' src="
					+ url + "></iframe>";
			$("#tabs").tabs('add', {
				title : text,
				content : myContext,
				closable : true

			});
		}

	}
</script>

</head>
<body class="easyui-layout">
	<div data-options="region:'north',title:'图书进销存后台管理系统',split:true"
		style="height: 120px;">
			<div align="right">
				<a id="btn" href="#" class="easyui-linkbutton"
				   style="width: auto; height: auto">欢迎<shiro:principal />登陆
				</a> <a id="btn" class="easyui-linkbutton" href="zhuxiao"
						style="width: auto; height: auto">注销</a>
				<a id="btn" class="easyui-linkbutton" href="#" style="width: auto; height: auto" onclick="javascript:openTabs('修改密码','user/alterPass.jsp')">修改密码</a>
			</div>

	</div>
	<!--     <div data-options="region:'south',title:'South Title',split:true" style="height:100px;"></div>   -->
	<!--     <div data-options="region:'east',title:'导航菜单',split:true" style="width:120px;"></div>   -->
	<div data-options="region:'west',title:'导航菜单',split:true"
		style="width: 150px;">
		<div class="easyui-accordion" data-options="fit:true">
			<s:hasAnyRoles name="admin,salesman">
				<div title="图书类型管理">
					<a id="btn" href="#" class="easyui-linkbutton"
						onclick="javascript:openTabs('图书类型管理','html/categoryList.html')"
						style="width: 100%">图书类型管理</a>
				</div>
			</s:hasAnyRoles>
			<s:hasAnyRoles name="admin,salesman">
				<div title="图书信息管理">
					<a id="btn" href="#" class="easyui-linkbutton"
						onclick="javascript:openTabs('图书信息管理','html/bookList.html')"
						style="width: 100%">图书信息管理</a>
				</div>

			</s:hasAnyRoles>
			<s:hasAnyRoles name="admin,salesman">
				<div title="销售信息管理">
					<a id="btn" href="#" class="easyui-linkbutton"
						onclick="javascript:openTabs('销售信息管理','html/marketList.html')"
						style="width: 100%">销售信息管理</a> 
						<a id="btn" href="#" class="easyui-linkbutton"
						onclick="javascript:openTabs('销售数据报表','html/anayseMarketList.html')"
						style="width: 100%">销售数据报表</a> 
				</div>
			</s:hasAnyRoles>
		
			<s:hasAnyRoles name="admin,customer">
				<div title="订单信息管理">
					<a id="btn" href="#" class="easyui-linkbutton"
						onclick="javascript:openTabs('订单信息管理','html/orderList.html')"
						style="width: 100%">订单信息管理</a>
				</div>
			</s:hasAnyRoles>
			<s:hasAnyRoles name="admin,salesman,customer">
				<div title="用户信息管理">
					<a id="btn" href="#" class="easyui-linkbutton"
						onclick="javascript:openTabs('用户信息管理','html/userList.html')"
						style="width: 100%">用户信息管理</a>
				</div>
			</s:hasAnyRoles>
			<s:hasAnyRoles name="admin">
				<div title="角色信息管理">
					<a id="btn" href="#" class="easyui-linkbutton"
						onclick="javascript:openTabs('角色信息管理','html/roleList.html')"
						style="width: 100%">角色信息管理</a>
				</div>
			</s:hasAnyRoles>
			<s:hasAnyRoles name="admin">
				<div title="日志信息管理">
					<a id="btn" href="#" class="easyui-linkbutton"
						onclick="javascript:openTabs('日志信息管理','html/logList.html')"
						style="width: 100%">日志信息管理</a>
				</div>
			</s:hasAnyRoles>

			<s:hasAnyRoles name="admin">
				<div title="SQL信息监控">
					<a id="btn" href="#" class="easyui-linkbutton"
						onclick="javascript:openTabs('SQL信息监控','<%=request.getContextPath() %>/druid/index.html')"
						style="width: 100%">SQL信息监控</a>
				</div>
			</s:hasAnyRoles>

		</div>

	</div>
	<div data-options="region:'center',title:'显示数据'">
		<div id="tabs" class="easyui-tabs" data-options="fit:true">
			<div title="首页"></div>
		</div>
	</div>
</body>
</html>